home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX 6.5 Applications 1998 June
/
SGI IRIX 6.5 Applications 1998 June.iso
/
dist
/
arraysvcs.idb
/
usr
/
lib
/
array
/
awho.z
/
awho
Wrap
Text File
|
1998-04-15
|
550b
|
31 lines
#!/bin/sh
#
# Simple script to implement "array who"
#
# Usage: awho local <name>
# or: awho merge <file....>
#
if [ "$1" = "local" ]; then
w |\
tail +3 |\
nawk 'BEGIN { Host = "'$2'" }; \
{ printf "%-8s %-12s %-14s %s\n", \
$1, Host, substr($0, 14, 14), substr($0, 59) }'
elif [ "$1" = "merge" ]; then
shift 1
echo "User Machine From What"
echo "----------------------------------------------------------"
sort $*
else
echo "Usage: awho local <hostname>"
echo " or: awho merge <output-file>..."
fi